<template>
  <div class="table-box" ref="tableBox">
    <el-table
      :data="tableData"
      :header-cell-style="{ padding: '0px', textAlign: 'center' }"
    >
      <el-table-column prop="date" label="日期" min-width="120">
      </el-table-column>
      <el-table-column prop="name" label="名字" min-width="120">
      </el-table-column>
      <el-table-column prop="province" label="地区" min-width="120">
      </el-table-column>
      <el-table-column prop="city" label="城市" min-width="120">
      </el-table-column>
      <el-table-column label="11月7日" min-width="100">
        <el-table-column prop="week" label="星期四" min-width="50">
          <el-table-column prop="num1" label="白班" min-width="50">
          </el-table-column>
          <el-table-column prop="num2" label="夜班" min-width="50">
          </el-table-column>
        </el-table-column>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          date: "2016-05-03",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1518 弄",
          zip: 200333,
          num1: 100,
          num2: 100,
        },
        {
          date: "2016-05-02",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1518 弄",
          zip: 200333,
          num1: 100,
          num2: 100,
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1518 弄",
          zip: 200333,
          num1: 100,
          num2: 100,
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1518 弄",
          zip: 200333,
          num1: 100,
          num2: 100,
        },
        {
          date: "2016-05-08",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1518 弄",
          zip: 200333,
          num1: 100,
          num2: 100,
        },
        {
          date: "2016-05-06",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1518 弄",
          zip: 200333,
          num1: 100,
          num2: 100,
        },
        {
          date: "2016-05-07",
          name: "王小虎",
          province: "上海",
          city: "普陀区",
          address: "上海市普陀区金沙江路 1518 弄",
          zip: 200333,
          num1: 100,
          num2: 100,
        },
      ],
    };
  },
  mounted() {
    this.tableHeight = this.$refs.tableBox.clientHeight - 40;
  },
};
</script>
<style scoped>
.table-box {
  height: calc(100vh - 330px); /*示例中顶部区域固定高度190px*/
}
</style>